package com.rfid.rls_psw;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.util.Log;
import android.widget.Toast;

import com.module.interaction.ModuleConnector;
import com.rfid.RFIDReaderHelper;
import com.rfid.ReaderConnector;
import com.rfid.afd.activity.HomeActivity;
import com.rfid.config.CMD;
import com.rfid.config.ERROR;
import com.rfid.rxobserver.RXObserver;
import com.rfid.rxobserver.bean.RXInventoryTag;

import java.io.FileOutputStream;
import java.io.IOException;
import java.security.InvalidParameterException;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";
    public static ModuleConnector connector = new ReaderConnector();
    private int baud = 115200;
    private long mStartTime;
    private long mTotalTime;
    private boolean mIsLoop = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},100);
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        App app = App.getInstance();
        app.init();
        HomeActivity.startActivity(this);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }
}